<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>主页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">

  <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/layui/css/admin.css" media="all">
</head>
<body>
<div class="layui-card-body">
    <blockquote class="layui-elem-quote" style="background: #fff;">欢迎{$admin.account}！当前时间: <span id="Date"></span></blockquote>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    会员数量
                    <span class="layui-badge layui-bg-orange layuiadmin-badge">☆</span>
                </div>
                <div class="layui-card-body layuiadmin-card-list">
                    <p class="layuiadmin-big-font">{$user_count}</p>
                    <!-- <p>
                        总会员量
                        <span class="layuiadmin-span-color">18<i class="layui-inline layui-icon layui-icon-user"></i></span>
                    </p> -->
                </div>
            </div>
        </div>

        <div class="layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    总销量
                    <span class="layui-badge layui-bg-orange layuiadmin-badge">☆</span>
                </div>
                <div class="layui-card-body layuiadmin-card-list">
                    <p class="layuiadmin-big-font">{$order_total}</p>
                    <!-- <p>
                        总营收
                        <span class="layuiadmin-span-color">18<i class="layui-inline layui-icon layui-icon-dollar"></i></span>
                    </p> -->
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/static/layui/layui.js"></script>
<script type="text/javascript">
    setInterval(function(){
        var date = new Date();
        var sign1 = "-";
        var sign2 = ":";
        var year = date.getFullYear(); // 年
        var month = date.getMonth() + 1; // 月
        var day  = date.getDate(); // 日
        var hour = date.getHours(); // 时
        var minutes = date.getMinutes(); // 分
        var seconds = date.getSeconds(); //秒
        var weekArr = [ '星期天','星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
        var week = weekArr[date.getDay()];

        // 给一位数数据前面加 “0”
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }

        if(day >= 0 && day <= 9){
            day = "0" + day;
        }

        if(hour >= 0 && hour <= 9){
            hour = "0" + hour;
        }

        if(minutes >= 0 && minutes <= 9){
            minutes = "0" + minutes;
        }

        if(seconds >= 0 && seconds <= 9){
            seconds = "0" + seconds;
        }

        //获取id=Date的标签，加入内容。
        var d = document.getElementById('Date');
        d.innerHTML = year + sign1 + month + sign1 + day + " " + hour + sign2 + minutes + sign2 + seconds + " " + week;
    }, 1000);
</script>
</body>
</html>